#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author:大爹
import tkinter as tk

from PIL import ImageTk, Image

import user_interface


def main_inter():
    window = tk.Tk()
    window.title('鹊桥相亲系统')
    window.geometry('1600x900')

    l = tk.Label(window, text='您好！欢迎使用鹊桥相亲系统', bg='green', font=('Arial', 12), width=200, height=2)
    q = tk.Label(window, text='请选择您的身份', bg='red', font=('Arial', 12), width=200, height=2)
    l2 = tk.Label(window, text='在鹊桥遇见懂你的人', bg='purple', font=('华文行楷', 40))
    l2.place(x=0, y=80, width=720, height=100)
    l3 = tk.Label(window, text='不开心了就来鹊桥', bg='blue', font=('华文行楷', 40))
    l3.place(x=820, y=80, width=700, height=100)
    l.pack()
    q.pack()

    def users():  # 修改为用户函数
        user_interface.users()

    def staff():  # 修改为工作人员函数
        print('1')

    def com():  # 修改为管理员函数
        print('f')

    b = tk.Button(window, text='用户', bg='yellow', font=('Arial', 12), width=10, height=1, command=users)
    b.pack()
    c = tk.Button(window, text='工作人员', bg='pink', font=('Arial', 12), width=10, height=1, command=staff)
    c.pack()
    b1 = tk.Button(window, text='管理员', bg='yellow', font=('Arial', 12), width=10, height=1, command=com)
    b1.pack()

    def get_img(filename, width, height):
        im = Image.open(filename).resize((width, height))
        im = ImageTk.PhotoImage(im)
        return im

    print()
    im_root = get_img('.\main_interface\choice2.jpg', width=1600, height=900)
    canvas_root = tk.Canvas(window, width=1600, height=900)
    canvas_root.create_image(800, 450, image=im_root)
    canvas_root.pack()

    window.mainloop()


if __name__ == '__main__':
    main_inter()
